// 定义基础模型
class BaseModel {
  constructor ({ message, data }) {
    this.message = message
    this.data = data
  }
}
// 成功模型
class SuccessModel extends BaseModel {
  constructor ({ code, message, data }) {
    super({ message, data })
    this.code = code || 200
  }
}
// 错误模型
class ErrorModel extends BaseModel {
  constructor ({ code, message, data }) {
    super({ message, data })
    this.code = code || -1
  }
}

module.exports = {
  SuccessModel,
  ErrorModel
}
